package cn.webrx.t2;

import java.util.concurrent.TimeUnit;

public class ThreadDemo {
    public static void main(String[] args) {
        ThreadDemo d = new ThreadDemo();
        new Thread(d::show,"d1").start();
        new Thread(d::show,"d2").start();
        new Thread(d::show,"d3").start();
        new Thread(d::show).start();
    }

    void show(){
        try{
            TimeUnit.SECONDS.sleep(1);
        }catch(Exception e){
            e.printStackTrace();
        }
        System.out.println(Thread.currentThread().getName());
    }
}
